#include <cmath>
using namespace std;
#include<iostream>

int main()
{
    float a = 0.0;
    char b = 'a';
    cin >> a >> b;
    int fee = 0;
    if(a <= 1)
        fee = 20;
    else
    {
        fee = 20;
        fee += ceil(--a);//天花板，向上取整
        // while(--a > 0)
        // {
        //     fee += 1;
        // }
    }
    if(b == 'y')
        fee += 5;
    cout << fee << endl;
    return 0;
}